// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.randomizedWorld.randomizedDeadSurvivor;

import java.util.ArrayList;
import zombie.core.Rand;
import zombie.inventory.InventoryItem;
import zombie.inventory.InventoryItemFactory;
import zombie.iso.BuildingDef;
import zombie.iso.RoomDef;
import zombie.iso.objects.IsoDeadBody;

public final class RDSDeadDrunk extends RandomizedDeadSurvivorBase {
    final ArrayList<String> alcoholList = new ArrayList();

    public RDSDeadDrunk() {
        this.name = "Dead Drunk";
        this.setChance(10);
        this.alcoholList.add("Base.WhiskeyFull");
        this.alcoholList.add("Base.WhiskeyEmpty");
        this.alcoholList.add("Base.Wine");
        this.alcoholList.add("Base.WineEmpty");
        this.alcoholList.add("Base.Wine2");
        this.alcoholList.add("Base.WineEmpty2");
    }

    @Override
    public void randomizeDeadSurvivor(BuildingDef def) {
        RoomDef roomDef = this.getLivingRoomOrKitchen(def);
        IsoDeadBody isoDeadBody = RandomizedDeadSurvivorBase.createRandomDeadBody(roomDef, 0);
        if (isoDeadBody != null) {
            int int0 = Rand.Next(2, 4);

            for (int int1 = 0; int1 < int0; int1++) {
                InventoryItem inventoryItem = InventoryItemFactory.CreateItem((String)this.alcoholList.get(Rand.Next(0, this.alcoholList.size())));
                isoDeadBody.getSquare().AddWorldInventoryItem(inventoryItem, Rand.Next(0.5F, 1.0F), Rand.Next(0.5F, 1.0F), 0.0F);
                def.bAlarmed = false;
            }

            isoDeadBody.setPrimaryHandItem(InventoryItemFactory.CreateItem("Base.WhiskeyEmpty"));
        }
    }
}
